﻿@*@model IEnumerable<SDE_FIC.Models.Turma>*@
@model PagedList.IPagedList<SDE_FIC.Models.Turma>
@using PagedList.Mvc
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />
@{
    ViewBag.Title = "Turma";
    Layout = "~/Views/Shared/_Layout_Sistema.cshtml";
}

<h2>@ViewBag.Title</h2>

<p>
    @Html.ActionLink("Nova Turma", "Create")
</p>

<table class="table table-bordered table-hover">
    <thead>
    <tr>
        <th>
            Descrição
        </th>
        <th>
            Professor
        </th>
@*        <th>
            Status
        </th>*@
        <th>
            Seg
        </th>
        <th>
            Ter
        </th>
        <th>
            Qua
        </th>
        <th>
            Qui
        </th>
        <th>
            Sex
        </th>
        <th>
            Sab
        </th>
        <th>
            Dom
        </th>
        <th>Ação</th>
    </tr>

    </thead>
@foreach (var item in Model) {
    <tbody>
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Descricao) - @Html.DisplayFor(modelItem => item.Curso.CursoNome)<br />
            <font size="1,5">
            <b>Horário: </b> @Html.DisplayFor(modelItem => item.Horario) - <b>Início:</b> @Html.DisplayFor(modelItem => item.DataInicio) - 
            <b>Término:</b> @Html.DisplayFor(modelItem => item.DataFim)</font>
        </td>
        <td style="text-align:center;">
            @Html.DisplayFor(modelItem => item.Funcionario.NomeCompleto)
        </td>
@*        <td style="text-align:center;">
             @Html.CheckBoxFor(modelItem => item.Status, new { @disabled = true })
        </td>*@
        <td style="text-align:center;">
            @Html.CheckBoxFor(modelItem => item.Segunda, new { @disabled = true })
        </td>
        <td style="text-align:center;">
            @Html.CheckBoxFor(modelItem => item.Terca, new { @disabled = true })
        </td>
        <td style="text-align:center;">
             @Html.CheckBoxFor(modelItem => item.Quarta, new { @disabled = true })
        </td>
        <td style="text-align:center;">
             @Html.CheckBoxFor(modelItem => item.Quinta, new { @disabled = true })
        </td>
        <td style="text-align:center;">
             @Html.CheckBoxFor(modelItem => item.Sexta, new { @disabled = true })
        </td>
        <td style="text-align:center;">
             @Html.CheckBoxFor(modelItem => item.Sabado, new { @disabled = true })
        </td>
        <td style="text-align:center;">
             @Html.CheckBoxFor(modelItem => item.Domingo, new { @disabled = true })
        </td>

          @if (Session["LogedUserPerfil"].ToString() == "coordenador") {    
        <td style="text-align:center;">
            <a href="@Url.Action("Edit", "Turma", new { id = item.Idturma })"><img src="~/Content/img/editar.png" alt="Editar"/></a>
            <a href="@Url.Action("Details", "Turma", new { id=item.Idturma })"><img src="~/Content/img/detalhes.png" alt="Detalhes"/></a>
            <a href="@Url.Action("Delete", "Turma", new { id = item.Idturma })"><img src="~/Content/img/excluir.png" alt="Excluir"/></a>
        </td>}else{
            <td style="text-align:center;">
<a href="@Url.Action("Edit", "Turma", new { id = item.Idturma })"><img src="~/Content/img/editar.png" alt="Editar"/></a>
            <a href="@Url.Action("Details", "Turma", new { id=item.Idturma })"><img src="~/Content/img/detalhes.png" alt="Detalhes"/></a>
            </td>
          }
    </tr>
   </tbody>
}

</table>
<div style="font-size:8pt;width:100%;text-align:right;" >
@Html.PagedListPager(Model, page => Url.Action("Index", new {pagina = page}))
</div>